#if !defined(AFX_MYLISTCTRL_H__53171609_849C_4D77_8BD2_6C7344EE9A23__INCLUDED_)
#define AFX_MYLISTCTRL_H__53171609_849C_4D77_8BD2_6C7344EE9A23__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MyListCtrl.h : header file
//

#define MAX_ROWS 10
#define MAX_COLS 4

//#include "NumSpinCtrl.h"
#include "NumEdit.h"
#include "NumSpinCtrl.h"

#include <vector>
using namespace std;

enum ELISTCTRLEDIT {
	elcNotEditable,
	elcEditable
};

/////////////////////////////////////////////////////////////////////////////
// CListCtrlEdit window
/*
#include "MyEdit.h"
#include "MyCombo.h"
*/

struct SLC_SPIN {
	float fDelta,
		  fLower, fUpper,
		  fPos;
};

class CListCtrlEdit : public CListCtrl
{
// Construction
public:
	CListCtrlEdit();
	
// Attributes
public:
//	CNumSpinCtrl *m_pEdit ;
	CNumEdit *m_pEdit;
//	CNumSpinCtrl *m_pSpin;
//	CComboBox *m_pCombo ;
	int m_iRow;
	int m_iCol;
	int m_MaxRowsPerView;
	bool m_bEditable;
// Operations
public:
	LRESULT  OnEdit();
//	LRESULT  OnCombo();
	void	vResetTopPosition();
	void	vResetBottomPosition();
	void	vAdjustWhenClickedOnPartialSqures(NMHDR* pNMHDR);
	void	OnSetText();
	void	VerifyScrollPos();
	void	EnableEdit( bool bEditable );
	int		HitTestEx(CPoint &point, int *col);

	SLC_SPIN m_SpinSettings;

	int InsertColumnEX( int nCol, const LVCOLUMN* pColumn, ELISTCTRLEDIT Editable );

	// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CListCtrlEdit)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	//}}AFX_VIRTUAL

// Implementation
private:
	vector <ELISTCTRLEDIT> m_vEditable;
public:
	virtual ~CListCtrlEdit();

	// Generated message map functions
protected:
	//{{AFX_MSG(CListCtrlEdit)
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg BOOL OnClick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	//}}AFX_MSG
	BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MYLISTCTRL_H__53171609_849C_4D77_8BD2_6C7344EE9A23__INCLUDED_)
